package com.lst.api.vo.response;

import com.lst.api.entity.Product;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
public class ProductResponse {

    @ApiModelProperty(name = "productId", value = "产品id", dataType = "Long")
    private Long productId;

    @ApiModelProperty(name = "title", value = "标题,产品名称", dataType = "String")
    private String title;

    @ApiModelProperty(name = "details", value = " 产品内容", dataType = "String")
    private String details;

    @ApiModelProperty(name = "maxQuota", value = "最大额度，单位元", dataType = "Integer")
    private Integer maxQuota;

    @ApiModelProperty(name = "years", value = "贷款年限", dataType = "Integer")
    private Integer years;

    @ApiModelProperty(name = "loanRate", value = "贷款利率", dataType = "Double")
    private Double loanRate;

    @ApiModelProperty(name = "taxLevel", value = "税务等级，多个的话逗号隔开", dataType = "String")
    private String taxLevel;
    
    @ApiModelProperty(name = "loanBankName", value = "贷款银行名称", dataType = "String")
    private String loanBankName;

    public ProductResponse(Product product) {
        if (product == null) {
            return;
        }
        this.productId = product.getId();
        this.title = product.getTitle();
        this.details = product.getDetails();
        this.maxQuota = product.getMaxQuota();
        this.years = product.getYears();
        this.taxLevel = product.getTaxLevel();
    }
}